import os
import re
from datetime import datetime

from .config import OSType, config
from .os.abc import OS
import cachetools
from .util import capture_to_datetime

device: OS

if config.os_type == OSType.WINDOWS:
    from .os.windows import WindowsOS
    device: OS = WindowsOS()
elif config.os_type == OSType.MACOS:
    from .os.macos import MacOS
    device: OS = MacOS()

capture_datetimes: list[datetime] = []
pattern = r'(\d{4})_(\d{2})_(\d{2})_(\d{2})_(\d{2})_(\d{2})'
for filename in os.listdir(config.capture_path):
    capture_datetimes.append(capture_to_datetime(filename))
